<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<c:if test="${not empty errors}">
	<c:forEach items="${errors}" var="error">
		${error.category} - ${error.message}<br />
	</c:forEach>
</c:if>

<form action="${pageContext.request.contextPath}/orientacoes" method="post">
  
	<c:if test="${not empty orientacao.id}">
		<input type="hidden" name="orientacao.id" value="${orientacao.id}"/>
		<input type="hidden" name="_method" value="put"/>
	</c:if>

	<div class="field">
		Dissertacao:<br />
	
		<input type="text" name="orientacao.dissertacao" value="${orientacao.dissertacao}"/>
	</div>
	
	<div class="field">
		Orientador:<br />
		<select name="orientacao.orientador.id">    
		  <c:forEach var="p" items="${professores}">    
		    <option value="${p.id}" ${p.id eq orientacao.orientador.id ? 'selected' : ''}>${p.nome}</option>    
		  </c:forEach>    
		</select>  
	</div>
	
	<div class="field">
		Aluno:<br />
		<select name="orientacao.aluno.id">    
		  <c:forEach var="a" items="${alunos}">    
		    <option value="${a.id}" ${a.id eq orientacao.aluno.id ? 'selected' : ''}>${a.nome}</option>    
		  </c:forEach>    
		</select>  
	</div>		
	
  <div class="actions">
	  <button type="submit">enviar</button>
	</div>
</form>

<a href="${pageContext.request.contextPath}/orientacoes">Voltar</a>
